package com.hua.argi;

/**
 * @author: _hua
 * @created: 2019/3/30.
 * @updater:
 * @description:
 */

/**
 * 使用头插法的链表
 */
public class StackSingleLink {
    private SingleLinkedList link;

    public StackSingleLink(){
        link = new SingleLinkedList();
    }
    //添加元素
    public void push(Object obj){
        link.addHead(obj);
    }

    //移除栈顶元素
    public Object pop(){
        return link.deleteHead();
    }
    //判断是否为空
    public boolean isEmpty(){
            return  link.isEmpty();
    }
    ////打印栈内元素信息
    public void display(){
         link.display();
    }
}
